package com.zhuimeng.service.impl;

import com.zhuimeng.dao.ResumeDao;
import com.zhuimeng.pojo.Resume;
import com.zhuimeng.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    ResumeDao resumeDao;


    @Override
    public Page<Resume> findAll(Integer pageNum,Integer pageSize) {
        return resumeDao.findAll(PageRequest.of(pageNum,pageSize));
    }

    @Override
    public Resume save(Resume resume) {
        return resumeDao.save(resume);
    }

    @Override
    public void deleteById(Long id) {
        resumeDao.deleteById(id);
    }

    @Override
    public Resume findById(Long id) {
        return resumeDao.findById(id).get();
    }


}
